﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WeLinkHelper.Model
{
    public class Content
    {
        public Content(string msg)
        {
            this.text = msg;
        }
        /// <summary>
        /// 消息内容
        /// </summary>
        public string text { get; set; }
    }

    public class RobotModel
    {
        /// <summary>
        /// 消息类型
        /// </summary>
        public string messageType { get; set; } = "text";
        /// <summary>
        /// 机器人地址
        /// </summary>

        public string robotUrl { get; set; }
        /// <summary>
        /// 内容对象
        /// </summary>
        public Content content { get; set; }
        /// <summary>
        /// 时间戳
        /// </summary>
        public long timeStamp
        {
            get
            {
                DateTime now = DateTime.Now;
                DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
                long timestamp = (long)(now.ToUniversalTime() - epoch).TotalMilliseconds;
                return timestamp;
            }
            set { timeStamp = value; }
        }
        /// <summary>
        /// uuid
        /// </summary>
        public string uuid { get; set; } = Guid.NewGuid().ToString();
        /// <summary>
        /// 是否@人
        /// </summary>
        public bool isAt { get; set; }
        /// <summary>
        /// 是否@所有人
        /// </summary>
        public bool isAtAll { get; set; }
        /// <summary>
        /// @人的列表
        /// </summary>
        public List<string> atAccounts { get; set; }
    }

}
